import instance from '@/utils/request'

// 获取分类列表
export const getArticleCates = () => {
  return instance.get('/my/articale/cates')
}

// 添加分类列表
export const addArticleCates = (form) => {
  return instance.post('/my/articale/addcates', {
    name: form.name,
    alias: form.alias
  })
}

// 删除分类列表
export const deleteCateById = (id) => {
  return instance.get(`/my/articale/deletecate/${id}`)
}

// 根据id获取分类列表
export const getArticleById = (id) => {
  return instance.get(`/my/articale/cates/${id}`)
}

// 修改分类列表
export const updateCateById = (form) => {
  console.log('form=>', form)

  return instance.post('/my/articale/updatecate', {
    Id: form.Id,
    name: form.name,
    alias: form.alias
  })
}
